{% extends "admin/layout.html" %}

{% block title %}创建任务 - {{ stage.name }} - {{ super() }}{% endblock %}

{% block content %}
<div class="card shadow-sm">
    <div class="card-header">
        <h5 class="card-title mb-0">为阶段「{{ stage.name }}」创建任务</h5>
    </div>
    <div class="card-body">
        <form method="post">
            <div class="mb-3">
                <label for="name" class="form-label">任务名称</label>
                <input type="text" class="form-control" id="name" name="name" required>
            </div>
            <div class="mb-3">
                <label for="description" class="form-label">任务描述</label>
                <textarea class="form-control" id="description" name="description" rows="3"></textarea>
            </div>
            <div class="mb-3">
                <label for="assignee_id" class="form-label">负责人</label>
                <select class="form-select" id="assignee_id" name="assignee_id">
                    <option value="">-- 选择负责人 --</option>
                    {% for member in stage.project.members %}
                    <option value="{{ member.member_id }}">{{ member.member.name }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="mb-3">
                <label for="due_date" class="form-label">截止日期</label>
                <input type="date" class="form-control" id="due_date" name="due_date">
            </div>
            <button type="submit" class="btn btn-primary">创建任务</button>
            <a href="{{ url_for('jira.project_detail', project_id=stage.project.id) }}" class="btn btn-secondary">取消</a>
        </form>
    </div>
</div>
{% endblock %}